package com.hk.aroundAdvice;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Pointcut;

@Aspect
public class Audience {


    /**
     * 定义切点以重用
     */
    @Pointcut("execution(* com.hk.aroundAdvice.Performance.perform())")
    public void perform(){}



    @Around("perform()")
    public void watchPerfomance(ProceedingJoinPoint pjp){
        try {
            System.out.println("A");
            System.out.println("B");
            pjp.proceed();
            System.out.println("Done");
        } catch (Throwable throwable) {
            throwable.printStackTrace();
            System.out.println("Throw");
        }
    }


}

